package com.maple.common;

/**
 * author: HuaZhe Ray
 * <p>
 * describe: ResultUtil
 * <p>
 * createDate: 2017/12/15
 * createTime: 10:10
 */
public class ResultUtil {

    public static ResultBean success(Object object) {
        ResultBean result = new ResultBean();
        result.setCode(200);
        result.setMessage("SUCCESS");
        result.setData(object);

        return result;
    }

    public static ResultBean success() {
        return success(null);
    }

    public static ResultBean error(Integer code, String msg) {
        ResultBean result = new ResultBean();

        result.setCode(code);
        result.setMessage(msg);

        return result;
    }
}
